home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / pc / files / dsp / 56200tar.z / 56200tar / 56200 / p4 < prev    next >
Text File  |  1992-04-28  |  10KB  |  196 lines

  1.  
  2.  
  3.          /***********************************************\
  4.          |**                                           **|
  5.          |**   DSP56200 CHIP DRIVER -ADAPTIVE FILTER   **|
  6.          |**                        -POLLED I/O        **|
  7.          |**                                           **|
  8.          \***********************************************/
  9.  
  10.  
  11.  
  12. /************************************************************************\
  13. *                                                                        *
  14. *   This file contains a flowchart of the host processor program used    *
  15. *   to setup and service the DSP56200 as a real-time adaptive filter.    *
  16. *   In this example, the host processor polls a general purpose input    *
  17. *   pin to determine the beginning of a new sample period, signified     *
  18. *   by the reception of a rising edge on the DSP56200's START pin. The   *
  19. *   general purpose input pin is tied directly to the START pin of the   *
  20. *   DSP56200.                                                            *
  21. *                                                                        *
  22. *                                                                        *
  23. *   The example system is configured as shown below:                     *
  24. *                                                                        *
  25. *                                                                        *
  26. *                               ------------                             *
  27. *                               | DSP56200 |                             *
  28. *                               ------------                             *
  29. *                                     ^                                  *
  30. *                                     |                                  *
  31. *                                     v                                  *
  32. *                  -------    ------------------                         *
  33. *          d(t) -->| A/D |--->| Host Processor |                         *
  34. *                  -------    |                |    -------              *
  35. *                             | (contains code |--->| D/A |--> out(t)    *
  36. *                  -------    |  found in this |    -------              *
  37. *         x1(t) -->| A/D |--->|     file)      |                         *
  38. *                  -------    ------------------                         *
  39. *                                                                        *
  40. *                                                                        *
  41. *                    Figure 1. Adaptive Filtering System                 *
  42. *                                                                        *
  43. *                                                                        *
  44. *                                                                        *
  45. *   There is only one DSP56200 in this example (i.e., not multiple       *
  46. *   DSP56200s in cascade), and it is configured as an adaptive filter    *
  47. *   (see Figure 2) by writing the DSP56200's Configuration register.     *
  48. *   Since only 16 bits of the result  are sent to the D/A Converter,     *
  49. *   the output is rounded to a 16 bit result by the DSP56200.            * 
  50. *                                                                        *
  51. *                                                                        *
  52. *                                                                        *
  53. *                                                                        *
  54. *         d(n) -------------------------------                           *
  55. *                                          - |                           *
  56. *                                            v                           *
  57. *                    --------------     +   ---                          *
  58. *        x1(n) ----->|    FIR     |------->| + |-----> out(n)            *
  59. *                    |  Structure |         ---           = -1 * error   *
  60. *                    --------------          |                           *
  61. *                          ^                 |                           *
  62. *                          |                 |                           *
  63. *                          -------------------                           *
  64. *                                                                        *
  65. *                                                                        *
  66. *                   Figure 2. DSP56200 Configuration                     *
  67. *                                                                        *
  68. *                                                                        *
  69. \************************************************************************/
  70.  
  71.  
  72.  
  73. Flowchart #2: Adaptive Filter Mode, Single Chip - Polled I/O
  74.  
  75.    Main Program:
  76.  
  77.  
  78.  
  79.                              -----------
  80.                              |  Begin  |
  81.                              -----------
  82.                                   |
  83.                                   +<---------
  84.                                   |          |
  85.                              -----------   No|
  86.                            /    START    \___
  87.                            \  Received ? /   
  88.                              -----------
  89.                                   | Yes
  90.                                   |
  91.                       -------------------------
  92.                       | Write Bank 1 Regs:    |
  93.                       |    CONFIG  = 99 (hex) |
  94.                       |    FTL     = ff (hex) |
  95.                       |    LEAKAGE = 00 (hex) |
  96.                       -------------------------
  97.                                   |              
  98.                        ------------------------  
  99.                        | Switch to Bank 0:    |  
  100.                        |    CONFIG = 98 (hex) |  
  101.                        ------------------------  
  102.                                   |              
  103.                        ------------------------  
  104.                        | Write Bank 0 Regs:   |  
  105.                        |    K    = 0400 (hex) |  
  106.                        |    X1     = 0        |  
  107.                        |    D      = 0        |  
  108.                        |    COEFF  = 0        |  
  109.                        |    RAMADR = 0        |  
  110.                        ------------------------  
  111.                                   |
  112.                                   +<---------
  113.                                   |          |
  114.                              -----------   No|
  115.                            /    START    \___
  116.                            \  Received ? /   
  117.                              -----------
  118.                                   | Yes
  119.                                   |              
  120.                             ------------
  121.                             |  tap = 1  |
  122.                             ------------
  123.                                   |              
  124.                     ------------->+
  125.                    |              |              
  126.                    |          ----------   
  127.                    |        / tap <= FTL \_______________
  128.                    |        \     ?      / No            |
  129.                    |          ----------                 |
  130.                    |              | Yes                  |
  131.                    |              |                      |
  132.                    |   ------------------------          |
  133.                    |   | Clear 1 Coefficient: |          |
  134.                    |   |    COEFF  = 0        |          |
  135.                    |   ------------------------          |
  136.                    |              |                      |
  137.                    |              +<---------            |
  138.                    |              |          |           |
  139.                    |         -----------   No|           V
  140.                    |       /    START    \___            |
  141.                    |       \  Received ? /               |
  142.                    |         -----------                 |
  143.                    |              | Yes                  |
  144.                    |              |                      |
  145.                    |       ---------------               |
  146.                    |       | tap = tap+1 |               |
  147.                    |       ---------------               |
  148.                    |              |                      |
  149.                    |              |                      |
  150.                     --------------                       |
  151.                                                          |
  152.                                                          |
  153.                                    ----------------------
  154.                                   |
  155.                                   |
  156.                        ------------------------  
  157.                        | Enable Updates:      |
  158.                        |    CONFIG = 90 (hex) |  
  159.                        ------------------------  
  160.                                   |              
  161.                                   |              
  162.              -------------------->+<---------
  163.             |                     |          |
  164.             |                -----------   No|
  165.             |              /    START    \___ 
  166.             |              \  Received ? /    
  167.             |                -----------  
  168.             |                     | Yes    
  169.             |                     |         
  170.             |           ---------------------
  171.             |           | Get 2 New Samples |
  172.             |           |   From the A/Ds   |
  173.             |           ---------------------
  174.             |                     |            
  175.             |         -------------------------
  176.             |         | Write the New Samples |
  177.             |         | to the X1 and D Regs  |
  178.             |         -------------------------
  179.             |                     |          
  180.             |        ----------------------------
  181.             |        |   Read the Error Term    |
  182.             |        | From the OUTPUT Register |
  183.             |        ----------------------------
  184.             |                     |
  185.             |           -----------------------
  186.             |           | Send the Error Term |
  187.             |           |     to the D/A      |
  188.             |           -----------------------
  189.             |                     |
  190.             |                     |
  191.              ---------------------
  192.                 (infinite loop)
  193.  
  194.  
  195.  
  196.